package com.ncloud.crm.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import com.ncloud.crm.entity.order.OrderContractNode;

/**
 * Created by shiqiang on 2017/4/21.
 */
@Mapper
public interface OrderContractNodeMapper {
    @Insert(value = "insert into bs_o_contract_node(order_id,child_contract_inst_id,modify_tag,node_id,begin_date,end_date,update_time,update_user) " +
            "values(#{orderId},#{childContractInstId},#{modifyTag},#{nodeId},#{beginDate},#{endDate},#{updateTime},#{updateUser})")
    public int insertContractNode(OrderContractNode orderAttr);
    
    @Select("select * from bs_o_contract_node where order_id = #{orderId}")
	@Results({ @Result(column = "order_id", property = "orderId"),
			@Result(column = "child_contract_inst_id", property = "childContractInstId"),
			@Result(column = "node_id", property = "nodeId"), @Result(column = "modify_tag", property = "modifyTag"),
			@Result(column = "begin_date", property = "beginDate"), @Result(column = "end_date", property = "endDate"),
			@Result(column = "update_time", property = "updateTime"),
			@Result(column = "update_user", property = "updateUser") })
	List<OrderContractNode> getOrderContractNodesByOrderId(Long orderId);
}

